package com.egrand.sweetapi.plugin.db;

import com.egrand.sweetapi.plugin.db.service.EgdTenantDataSourceService;
import com.gitee.bluesweeter.plugin.SpringPlugin;
import org.pf4j.PluginWrapper;

public class DbAdapterPlugin extends SpringPlugin {

    public DbAdapterPlugin(PluginWrapper wrapper) {
        super(wrapper);
    }

    @Override
    public void stop() {
        if (null != this.getApplicationContext() && null != this.getApplicationContext().getBean(EgdTenantDataSourceService.class))
            this.getApplicationContext().getBean(EgdTenantDataSourceService.class).deschedule();
        super.stop();
    }
}
